@extends('admin.layout.layout')
@section('content')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span><i class="icon-table"></i> 品牌列表</span>
        </div>
        <div class="mws-panel-body no-padding">
         <form method="get" action="">
            <div role="grid" class="dataTables_wrapper" id="DataTables_Table_1_wrapper">
                <div id="DataTables_Table_1_length" class="dataTables_length">
                    <label>每页显示条数
                        <select name="pagenum" size="1" aria-controls="DataTables_Table_1">
                            <option value="10" selected="selected">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                        </select> 条
                    </label></div>
            <div class="dataTables_filter" id="DataTables_Table_1_filter">
                <label>搜索:<input type="text" name='keyword' aria-controls="DataTables_Table_1">
                    <input type="submit" class="btn btn-danger" value="搜索">
            </label>
             </div>
            </form>
            <table class="mws-datatable-fn mws-table dataTable" id="DataTables_Table_1" aria-describedby="DataTables_Table_1_info">
                    <thead>
                    <tr role="row">
                        <th class="sorting_asc" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:156px;
    " aria-sort="ascending" aria-label="Rendering engine:activate to sort column descending">品牌id</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:212px;
    " aria-label="Browser:activate to sort column ascending">品牌名</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:197px;
    " aria-label="Platform(s):activate to sort column ascending">Logo</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:133px;
    " aria-label="Engine version:activate to sort column ascending">官网地址</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">添加时间</th>
                        <th class="sorting" role="columnheader" tabindex="0" aria-controls="DataTables_Table_1" rowspan="1" colspan="1" style="width:97px;
    " aria-label="CSS grade:activate to sort column ascending">操作</th>
                    </tr>
                    </thead>

                    <tbody role="alert" aria-live="polite" aria-relevant="all">
                    @foreach($data as $v)
                    <tr class="odd">
                        <td >{{$v['pp_id']}}</td>
                        <td >{{$v['pp_name']}}</td>
                        <td ><img style="width:100px;heigth:100px" src="/{{$v['pp_logo']}}"/> </td>
                        <td >{{$v['pp_url']}}</td>
                        <td >{{date('Y-m-d H:i:s',time())}}</td>
                        <td >
                            <a href="/admin/pinpai/edit/{{$v['pp_id']}}"><i style="color:black;font-size: 20px;" title="修改" class="icon-pencil-2"></i></a>&nbsp;&nbsp;&nbsp;
                            <a href="javascript:;"><i onclick="del({{$v['pp_id']}})" style="color:black;font-size: 20px;" title="删除" class="icon-trash"></i></a>
                        </td>
                    </tr>
                    @endforeach
                    </tbody>
            </table>
            <div id="page_page">
                {!! $data->appends('request')->render() !!}
            </div>
            </div>
    </div>
    <script>
        function del(id){
            $.get('/admin/pinpai/delete/'+id,function(data){
                if(data['status']==0){
                    location.href = location.href;
                }else{

                }
            });
        }
    </script>
    @endsection
